<template>
  <div>
    <el-button type="text" @click="jumpInformPage()"
      >查看待审核开发者信息</el-button
    >
    <!-- 表格 -->
    <el-table :data="list" border style="width: 100%">
      <el-table-column
        prop="father_idnumber"
        label="开发者身份证号"
        header-align="center"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="father_login_date"
        label="开发者注册日期"
        header-align="center"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="father_name"
        label="开发者公司名称"
        header-align="center"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="father_power"
        label="开发者权限"
        header-align="center"
        align="center"
      >
        <template slot-scope="scope">
          <span>{{ scope.row.father_power === '0' ? '正常' : '封号' }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="father_real_name"
        label="开发者真实姓名"
        header-align="center"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="father_state"
        label="开发者状态"
        header-align="center"
        align="center"
      >
        <!-- 插槽三元表达式 -->
        <template slot-scope="scope">
          <span>{{
            scope.row.father_state === 0 ? '待审核' : '审核不通过'
          }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="user_name" label="用户姓名" header-align="center" align="center">
      </el-table-column>
      <el-table-column
        prop="administrators_name"
        label="管理员名称"
        header-align="center"
        align="center"
      >
      </el-table-column>
      <el-table-column
        prop="father_audit_date"
        label="审核日期"
        header-align="center"
        align="center"
      >
      </el-table-column>
      <!-- <el-table-column label="操作" header-align="center" align="center">
          <template slot-scope="scope">
            <el-button
              type="warning"
              plain
              @click="changeStatus(scope.$index, scope.row)"
              size="mini"
              >更改状态</el-button
            >
          </template>
        </el-table-column> -->
    </el-table>
    <!-- 分页器 -->
    <el-pagination
      @current-change="changePage"
      v-show="shows"
      :current-page.sync="currentPage"
      :page-size="pageSize"
      background
      layout="prev, pager, next, jumper"
      :total="total"
    ></el-pagination>
  </div>
</template>
<script>
import http from '../api/index';
export default {
  data() {
    return {
      list: [],
      currentPage: 1,
      pageSize: 1,
      shows: true,
      total: 0,
    };
  },
  mounted() {
    http
      .getCheckedDevErr({
        pages: 1,
        father_state: 2,
      })
      .then((r) => {
        console.log(r);
        this.list = r.data;
        this.total = parseInt(r.msg);
      });
  },
  methods: {
    // 分页
    changePage(val) {
       http
      .getCheckedDevErr({
        pages: val,
        father_state: 2,
      })
      .then((r) => {
        console.log(r);
        this.list = r.data;
        this.total = parseInt(r.msg);
      });
      console.log(val);
    },
    jumpInformPage() {
      this.$router.push('/index/check/checkDevlop');
    },
  },
};
</script>